
package com.yksj.healthtalk.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.yksj.healthtalk.ui.R;

public class PersonAdapter extends BaseAdapter {

	private Context context;
	private String[] arr;
	private boolean flage;
	private int count;

	public PersonAdapter(Context context, String[] array,boolean flag) {
		this.context = context;
		this.arr = array;
		flage=flag;
		count = flag?arr.length+1:arr.length;
	}

	@Override
	public int getCount() {
		return count;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View view=LayoutInflater.from(context).inflate(R.layout.person_biaoqian_itemer, null);
		TextView iterm_text = (TextView)view.findViewById(R.id.iterm_text);
				if(position==arr.length){
					if(flage){
						iterm_text.setText("+");
					}
				}else{
					iterm_text.setText(arr[position]);
					}
		
		return view;
	}

}
